# coding=utf-8

try:
    with open("mima.txt", "rt") as object_pwd:
	    passwd = object_pwd.readline()
except IOError as err: 
	print ("没有文件 " + str(err))
else:
    count = 0
    while count < 3:
	    input_pwd = input("please input your password: ")
	    if input_pwd == passwd:
		    print("\n密码正确")
		    break
	    print("密码错误")
	    count += 1
    else:
	    print("\n错误三次，退出")

